﻿#region Disclaimer/Info
///////////////////////////////////////////////////////////////////////////////////////////////////
// MetaCollection
// 
// MetaCollection is a system to provide a standard structure, permissions and metadata service
// for content organization.
//
// This project is hosted at Google Code at http://code.google.com/p/metacollection/
//
// This project is licensed under the BSD license.  See the License.txt file for more information.
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion

using System;
using System.Linq;
using System.Linq.Expressions;
using MetaCollection.Framework.Model;
using System.Collections.Generic;
using MetaCollection.Framework.Change;

namespace MetaCollection.Framework.Repository
{
	public interface IModelRepository : IRepository
	{
		/// <summary>
		/// Find the provider by Id
		/// </summary>
		/// <param name="id">The id of the provider.</param>
		/// <returns>An IProviderType record for the given Id or null if no object found</returns>
		IItemSpecification FindSpecification(Guid id);

		/// <summary>
		/// Finds the resource provider type configuration record given a specific resource type name
		/// </summary>
		/// <param name="name">the name of the resource type handler</param>
		/// <returns>a resource type record</returns>
		IItemSpecification FindSpecificationByName(string name);

		/// <summary>
		/// Puts the model Specification into persistant storage or updates an existing model specification.
		/// </summary>
		/// <param name="item"></param>
		void SaveSpecification(IItemSpecification item);

		/// <summary>
		/// Finds all registered item specification models in the repository
		/// </summary>
		/// <returns>A collection IItemSpecifications.</returns>
		IEnumerable<IItemSpecification> RegisteredSpecifications { get; }
	}
}
